function e(o, i, a, f) {
    f.header = "object" === t(f.header) ? f.header : {};
    var s = getApp().globalData.authToken;
    if (c[i]) 2 === c[i] && (!s || (f.header.Authorization = s)); else {
        if (!s) return void require("0BACB9C3A71FB5DF6DCAD1C4BE4CA4D1.js").login(function(t) {
            1001 === t ? e(o, i, a, f) : "function" == typeof f.fail && f.fail({
                errMsg: "登录授权失败"
            });
        });
        f.header.Authorization = s;
    }
    var l = wx.request({
        url: f.noNeedBASE_URL ? i : u + i,
        data: a,
        method: o.toUpperCase(),
        header: Object.assign({
            Accept: "application/vnd.whosssmade.api+json;version=1"
        }, f.header),
        success: function(t) {
            return n({
                res: t,
                request: e,
                method: o,
                url: i,
                data: a,
                config: f,
                type: "request"
            });
        },
        fail: function(e) {
            return r(e, i, f);
        },
        complete: function() {
            "function" == typeof f.complete && f.complete();
        }
    });
    "function" == typeof f.callback && f.callback(l);
}

var t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
    return typeof e;
} : function(e) {
    return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, o = require("C730AF20A71FB5DFA156C7279F1CA4D1.js"), n = o.netSuccess, r = o.netFail, i = require("B7F487A3A71FB5DFD192EFA4970CA4D1.js"), u = i.BASE_URL, c = i.nonAuthApi, a = {};

[ "options", "get", "head", "post", "put", "delete", "trace", "connect" ].forEach(function(t) {
    a[t] = function(o) {
        var n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {};
        return new Promise(function(i, u) {
            r.success = function(e) {
                return i(e);
            }, r.fail = function(e) {
                return u(e);
            }, e(t, o, n, r);
        });
    };
}), module.exports = a;